package com.mxpio.erp.quality.service.impl;

import com.mxpio.erp.common.quality.entity.InspectionItem;
import com.mxpio.erp.common.quality.entity.InspectionScheme;
import com.mxpio.erp.common.quality.entity.InspectionSchemeChain;
import com.mxpio.erp.common.quality.entity.InspectionSchemeLine;
import com.mxpio.erp.common.quality.service.InspectionSchemeLineService;
import com.mxpioframework.jpa.JpaUtil;
import com.mxpioframework.system.service.impl.BaseServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class InspectionSchemeLineServiceImpl extends BaseServiceImpl<InspectionSchemeLine> implements InspectionSchemeLineService {
    @Override
    @Transactional
    public List<InspectionSchemeLine> listBySchemeCode(String schemeCode) {
        return JpaUtil.linq(InspectionSchemeLine.class)
                .collect("code", InspectionItem.class,"code")
                .equal("schemeCode",schemeCode)
                .list();
    }
}
